// ignore_for_file: prefer_const_constructors_in_immutables

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:verse_systems/commom/global/global.dart';
import 'package:verse_systems/res/colors.dart';
import 'package:verse_systems/res/styles.dart';
import 'package:verse_systems/utils/image_utils.dart';

class CustomizeAppbar extends StatelessWidget implements PreferredSizeWidget {
  final String? title;

  CustomizeAppbar({super.key, this.title});

  @override
  Widget build(BuildContext context) {
    return AppBar(
      backgroundColor: Colours.app_main_background_color,
      title: Text(
        title ?? "",
        style: TextStyles.textTitle,
      ),
      elevation: 0,
      centerTitle: true,
      systemOverlayStyle: SystemUiOverlayStyle.light,
      leading: Builder(builder: (BuildContext context) {
        return IconButton(
            icon: Image.asset(
              ImageUtils.getFromAssetImage("menu"),
              fit: BoxFit.fill,
            ),
            onPressed: () {
              Global.scaffoldKey.currentState!.openDrawer();
            });
      }),
    );
  }

  @override
  Size get preferredSize => Size.fromHeight(58.w);
}
